import * as Sentry from '@sentry/astro';

Sentry.init({
  dsn: import.meta.env.PUBLIC_E2E_TEST_DSN,
  environment: 'qa',
  tracesSampleRate: 1.0,
  tunnel: 'http://localhost:3031/', // proxy server
  integrations: [
    Sentry.browserTracingIntegration({
      beforeStartSpan: opts => {
        if (opts.name.startsWith('/blog/')) {
          return {
            ...opts,
            name: window.location.pathname,
          };
        }
        return opts;
      },
    }),
  ],
});
